import 'package:flutter_test/flutter_test.dart';
import 'package:add_white_list_plugin/add_white_list_plugin.dart';
import 'package:add_white_list_plugin/add_white_list_plugin_platform_interface.dart';
import 'package:add_white_list_plugin/add_white_list_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockAddWhiteListPluginPlatform
    with MockPlatformInterfaceMixin
    implements AddWhiteListPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<void> addWhite({String? reason}) async {
  }
}

void main() {
  final AddWhiteListPluginPlatform initialPlatform = AddWhiteListPluginPlatform.instance;

  test('$MethodChannelAddWhiteListPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelAddWhiteListPlugin>());
  });

  test('getPlatformVersion', () async {
    AddWhiteListPlugin addWhiteListPlugin = AddWhiteListPlugin();
    MockAddWhiteListPluginPlatform fakePlatform = MockAddWhiteListPluginPlatform();
    AddWhiteListPluginPlatform.instance = fakePlatform;

    expect(await addWhiteListPlugin.getPlatformVersion(), '42');
  });
}
